#include "CameraView.h"
#include "OgreRenderBox/RenderBox.h"
#include "RGlobal.h"

wraps::RenderBox gRenderBox;

void CCameraView::CameraView_Created()
{
	const MyGUI::IntSize& size = mGUI->getViewSize();
	MyGUI::Window* window = mGUI->createWidget<MyGUI::Window>("StaticImage", MyGUI::IntCoord(10, size.height - 10 - 230, 300, 230), MyGUI::Align::Default, "Overlapped");
	window->setCaption("Camera view");
	window->setMinSize(100, 100);

	MyGUI::Canvas* canvas = window->createWidget<MyGUI::Canvas>("Canvas", MyGUI::IntCoord(0, 0, window->getClientCoord().width, window->getClientCoord().height), MyGUI::Align::Stretch);

	gRenderBox.setCanvas(canvas);
	gRenderBox.setViewport(mCamera);
	//gRenderBox.setBackgroundColour(MyGUI::Colour::Black);
}